package javase.javase01.exercise09;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author: Gan
 * @date 2021/4/14 0014 13:57
 * @description:
 **/
public class Demo3 {
    public static void main(String[] args) {
        Date date = new Date();
        Date date1 = new Date();
        DateFormat dateFormat = new SimpleDateFormat();
        date = null;
        try {
            date  = DateFormat.getDateInstance().parse(String.valueOf(date));
        } catch (ParseException e) {
            e.printStackTrace();
            String message = e.getMessage();
            System.out.println(message);

        }finally {
            System.out.println("finally的代码块也执行了");
        }

    }
}
